package pers.jason.wppm.workflow.entity;

import lombok.Data;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.runtime.ProcessInstance;

import java.io.Serializable;

/**
 * @Author: JZH
 * @Date: 2018/11/14 22:31
 * @Description:
 */
@Data
public class ProcessInstanceResult implements Serializable{

    private static final long serialVersionUID = 1L;



    private String tenantId = ProcessEngineConfiguration.NO_TENANT_ID;

    private String name;

    private String description;

    private String localizedName;

    private String localizedDescription;

    private String processDefinitionId;

    private String processDefinitionKey;

    private String processDefinitionName;

    private Integer processDefinitionVersion;

    private String deploymentId;

    private String activityId;

    private String processInstanceId;

    private String businessKey;

    private String parentId;


    public ProcessInstanceResult() {
    }

    public ProcessInstanceResult(ProcessInstance processInstance) {
        this.tenantId = processInstance.getTenantId();
        this.name = processInstance.getName();
        this.description = processInstance.getDescription();
        this.localizedName = processInstance.getLocalizedName();
        this.localizedDescription = processInstance.getLocalizedDescription();
        this.processDefinitionId = processInstance.getProcessDefinitionId();
        this.processDefinitionKey = processInstance.getProcessDefinitionKey();
        this.processDefinitionName = processInstance.getProcessDefinitionName();
        this.processDefinitionVersion = processInstance.getProcessDefinitionVersion();
        this.deploymentId = processInstance.getDeploymentId();
        this.activityId = processInstance.getActivityId();
        this.processInstanceId = processInstance.getProcessInstanceId();
        this.businessKey = processInstance.getBusinessKey();
        this.parentId = processInstance.getParentId();
    }
}
